

#[derive(Debug)]
enum SpreadsheetCell {
    Age(i32),
    Name(String),
    Weight(f64),
}

pub fn test() {
    let v: Vec<i32> = Vec::new();
    println!("v1: {:?}", v);

    let mut v = vec![1, 2, 3];
    println!("v2 is {:?}", v);

    v.push(4);
    println!("v2 now is {:?}", v);

    let third = &v[2];
    println!("third is {}", third);
    let four = v.get(3); // Option<T>
    if let Some(val) = four {
        println!("forth is {}", val);
    }

    for i in v {
        println!("element is {}", i);
    }
    
    let row = vec![SpreadsheetCell::Age(32), SpreadsheetCell::Name(String::from("lin xq")), SpreadsheetCell::Weight(57.5)];
    println!("row is {:?}", row);

}
